<template>
	<div>
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
			<el-row>
				<el-col :span="12">
					<el-form-item label="是否存在评分细则" prop="existbidscore" >
						<el-select v-model="projectinfo.existbidscore" filterable @change="changeExistBidScore">
							<el-option v-for="item in codeModel.enabledList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
    </el-form>
    <tl-approval-history ref="history" sourceType="MpmProjectUnBidScore" :sourceId="model.id" />
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="doSubmitApproval" :loading="submitLoading" v-if="!disableEditSubmit" :disabled="disableApproval"><svg-icon icon-class="send" />提交审批</el-button>
    </div>
	</div>
</template>

<script>
/** mixins */
import { mixin_approval_edit } from '@tapui/mixins/mixin_approval_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_approval_edit],
  components: { },
  data() {
    return {
      moduleTitle: '评标细则不创建申请表',
      urlPrefix: '/mpm/projectUnBidScore/',
      url: {
        // 额外的url
		updateProjectInfo: '/mpm/projectBidScore/updateProjectInfo/'
      }
    }
  },
  props: {
    projectinfo: {}
  },
  methods: {
	changeExistBidScore() {
      getAction(this.url.updateProjectInfo, { projectcode: this.projectinfo.projectcode, existbidscore: this.projectinfo.existbidscore, projectname: this.projectinfo.projectname }).then((res) => {})
    },
    assignDefaultValue() {
      if (this.isAdd) {
        if (this.codeModel.flowidList && this.codeModel.flowidList.length > 0) {
          this.$set(this.model, 'flowid', parseInt(this.codeModel.flowidList[0].id))
        }
        this.$set(this.model, 'orgcode', this.org.code)
        this.$set(this.model, 'disporgcode', this.org.name)
        this.$set(this.model, 'deptcode', this.dept.code)
        this.$set(this.model, 'deptname', this.dept.fullname)
        this.$set(this.model, 'usercode', this.user.code)
        this.$set(this.model, 'username', this.user.name)
      }
    },
    loaded() {
      // 页面加载完毕执行
      if (!this.isAdd && this.model.docno) {
        this.title = this.title + `（单据编号：${this.model.docno}）`
      }
    }
  }
}
</script>

